package com.stupro.cjlu.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.stupro.cjlu.common.vo.StudentInfoVO;
import com.stupro.cjlu.common.vo.StudentItemVO;
import com.stupro.cjlu.entity.Students;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Administrator
 * @since 2021-05-10
 */
@Mapper
@Repository
public interface StudentsMapper extends BaseMapper<Students> {
    /*Integer getDepartmentIdById(Integer stuID);*/

    /*Integer getGradeById(Integer stuID);*/

    Integer count(@Param("stuClass") String stuClass, @Param("stuName")String stuName);

    @Select("select * from students " +
            "where stuClass like '%${stuClass}%' and stuName like '%%${stuName}'")
    IPage<StudentItemVO> getPage(IPage<StudentItemVO> page,@Param("stuClass") String stuClass,
                                 @Param("stuName") String stuName);

    StudentInfoVO getStudentInfoById(Integer stuID);
}
